<include file="Public/min-header"/>
<div class="wrapper">
    <include file="Public/breadcrumb"/>
    <section class="content">
        <!-- Main content -->
        <div class="container-fluid">
            <div class="pull-right">
                <a href="javascript:history.go(-1)" data-toggle="tooltip" title="" class="btn btn-default" data-original-title="返回"><i class="fa fa-reply"></i></a>
            </div>
            <div class="panel panel-default">
                <div class="panel-heading">
                    <h3 class="panel-title"><i class="fa fa-list"></i> 添加类型</h3>
                </div>
                <div class="panel-body">
                    <ul class="nav nav-tabs">
                        <li class="active"><a href="#tab_tongyong" data-toggle="tab">店铺类型</a></li>
                    </ul>
                    <!--表单数据-->
                    <form method="post" action="{:U('Shop/shop_type_update')}" id="addEditBrandForm" onsubmit="return checkName();">
                        <!--通用信息-->
                        <div class="tab-content">
                            <div class="tab-pane active" id="tab_tongyong">

                                <table class="table table-bordered">
                                    <tbody>
                                    <tr>
                                        <td>类型名称:</td>
                                        <td>
                                            <input type="text" value="{$data['shop_type_name']}" name="shop_type_name" class="form-control" style="width:200px;"/>
                                            <input type="hidden" name="ids" value="{$data['id']}"/>
                                            <span id="err_name" style="color:#F00; display:none;">类型名称不能为空</span>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>保证金:</td>
                                        <td>
                                            <input type="text" value="{$data['bond_price']}" name="bond_price" class="form-control" style="width:200px;" placeholder="50"/>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>类型排序:</td>
                                        <td>
                                            <input type="text" value="{$data['sort']}" name="sort" class="form-control" style="width:200px;" placeholder="50"/>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>是否显示:</td>

                                        <td id="order-status">
                                            <if condition="$data['is_show'] eq 1">
                                                <input name="is_show" type="radio" value="1" checked>显示
                                                <input name="is_show" type="radio" value="0">不显示
                                                <else />
                                                <input name="is_show" type="radio" value="1">显示
                                                <input name="is_show" type="radio" value="0" checked>不显示
                                            </if>

                                        </td>
                                    </tr>
                                    </tbody>
                                </table>
                            </div>
                        </div>
                        <div class="pull-right">
                            <input type="hidden" name="id" value="{$brand.id}">
                            <input type="hidden" name="p" value="{$_GET[p]}">
                            <button class="btn btn-primary" data-toggle="tooltip" type="submit" data-original-title="保存">保存</button>
                        </div>
                    </form><!--表单数据-->
                </div>
            </div>
        </div>    <!-- /.content -->
    </section>
</div>
<script>
    // 判断输入框是否为空
    function checkName(){
        var name = $("#addEditBrandForm").find("input[name='shop_type_name']").val();
        if($.trim(name) == '')
        {
            $("#err_name").show();
            return false;
        }
        return true;
    }


</script>
</body>
</html>